package by.sjc.grsu.service.impl;

import by.sjc.grsu.dao.repositiory.AccountDao;
import by.sjc.grsu.model.Account;
import by.sjc.grsu.service.AccountService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {

    public static final Logger logger = Logger.getLogger(AccountService.class);

    @Autowired
    private AccountDao accountDao;

    @Override
    public Account registerUserAccount(Account account) {
        accountDao.registerAccount(account);
        return accountDao.loadAccountByEmail(account.getEmail());
    }
}
